<div class="center_content">
	<div class="left_content">
		<ul class="nav nav-list">
			<li class="nav-header">
				<%= t('Category') %>
			</li>
			<% @categories.each do |category| %>
			<% if(@category.name == category.name) %>
			<li class="active">
				<% if session[:language] == 'vi' %>
					<%= link_to category.name, :controller => 'categories',:action => 'show',:id => category.id%>
				<% else %>
					<%= link_to category.description, :controller => 'categories',:action => 'show',:id => category.id%>
				<% end%>
			</li>
			<% else %>
			<li>
				<% if session[:language] == 'vi' %>
					<%= link_to category.name, :controller => 'categories',:action => 'show',:id => category.id%>
				<% else %>
					<%= link_to category.description, :controller => 'categories',:action => 'show',:id => category.id%>
				<% end%>
			</li>
			<% end %>
			<% end %>
		</ul>
	</div>
	<div class="right_content">
		
		<div class="search">
			<%= form_tag search_default_index_path, :method => :get,:class =>"navbar-form pull-left" do %>
				<%= select_tag :search_type, options_for_select(["Author", "Title", "ID Book"]), :class => "input-small search-filter" %>
				<%= text_field_tag :search_value, nil, :class => "search-input" %>
				<div class="search-btn">
					<%= submit_tag t("Search"), :class => 'btn'%>
				</div>
			<% end %>
		</div>
		
		<div class = "category">
			<div class = "category_title">
				<% if session[:language]%>
				<% if session[:language] == 'vi'%>
				<span><%= @category.name %></span>
				<% else%>
				<span><%= @category.description %></span>
				<% end%>
				<% else%>
				<span><%= @category.description %></span>
				<% end%>
				<%= link_to t('Back'), :controller => 'default',:action => 'index' %>
			</div>
			<% if @books.size != 0 %>
				<div class = "book_show">
					<ul>
						<% @books.each do |book| %>
						<li>
							<%=link_to (image_tag book.image_url),:controller => 'bookDetail',:action => 'show',:id => book.id%>
							<div class="data">
								<div class = "title">
									<%=link_to book.title,:controller => 'bookDetail',:action => 'show',:id => book.id%>
								</div>
								<%= t('by') %> <div class = "author"> <%= book.author %></div>
								<% if(book.description.length > 400)%>
									<p> <%= book.description[0,400].concat("...") %></p>
								<% else %>
									<p> <%= book.description %></p>
								<% end%>
							</div>
						</li>
						<% end %>
					</ul>
				</div>
			<% end %>
		</div>
		
	</div>
</div>
